﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ChiTietSanPham.aspx.cs" Inherits="admin_ChiTietSanPham" MasterPageFile="~/admin/MasterPage.master" %>
<%@ Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor" %>
        <asp:Content ID="contentNoiDung" ContentPlaceHolderID="contentNoiDung" Runat="Server">
		
		<div id="main-content"> <!-- Main Content Section with everything -->
			
			
			<!-- Page Head -->
			<div class="content-box"><!-- Start Content Box -->
				
				<div class="content-box-header">
					
					<h3 style="cursor: s-resize; "><asp:Label runat="server" ID="lbTenSanPham"></asp:Label></h3>
					<ul class="content-box-tabs">
                        <li><a href="#tab1" class="default-tab current">Chi tiết</a></li>
                        <!-- href must be unique and match the id of target div -->
                        <li><a href="#tab2">Album ảnh</a></li>
                    </ul>
					<div class="clear"></div>
					
				</div> <!-- End .content-box-header -->
				
				<div class="content-box-content">
					
					<div class="tab-content default-tab" id="tab1" style="display: block;">
				
							<fieldset> <!-- Set class to "column-left" or "column-right" on fieldsets to divide the form into columns -->
								
                    <div>
                        <form action="" method="post">
                        <fieldset>
                            <!-- Set class to "column-left" or "column-right" on fieldsets to divide the form into columns -->
                            <div class="formleft">
                                <p>
                                    <label>
                                        Tên sản phẩm</label>
                                    <asp:TextBox ID="txtTenSanPham" runat="server" CssClass="text-input large-input"></asp:TextBox>
                                </p>
                                <div class="formleft">
                                    <p>
                                        <label>
                                            Loại sản phẩm</label>
                                        <asp:DropDownList runat="server" ID="ddlLoaiCha" AutoPostBack="true" OnSelectedIndexChanged="ddlLoaiCha_OnSelectedIndexChanged">
                                        </asp:DropDownList>
                                    </p>
                                </div>
                                <div class="formright">
                                    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                                        <ContentTemplate>
                                            <p>
                                                <label>
                                                    >></label>
                                                <asp:DropDownList runat="server" ID="ddlLoaiCon">
                                                </asp:DropDownList>
                                            </p>
                                        </ContentTemplate>
                                        <Triggers>
                                            <asp:AsyncPostBackTrigger ControlID="ddlLoaiCha" EventName="SelectedIndexChanged" />
                                        </Triggers>
                                    </asp:UpdatePanel>
                                </div>
                                <div class="formleft">
                                    <p>
                                        <label>
                                            Sản phẩm mới?</label>
                                        <asp:CheckBox ID="ckSanPhamMoi" runat="server" />Có
                                    </p>
                                </div>
                                <div class="formright">
                                    <p>
                                        <label>
                                            Thứ tự</label>
                                        <asp:TextBox ID="txtThuTu" runat="server" CssClass="text-input large-input"></asp:TextBox>
                                    </p>
                                </div>
                                <p>
                                    <label>
                                        Hình ảnh</label>
                                    <input type="file" id="inputFile" name="inputFile" runat="server" />
                                    <asp:CheckBox id="chkDeleteFile" runat="server" Text="Delete"/>
                                    <asp:TextBox ID="txtHinhAnh" runat="server" Width="450px" Visible="false">
                                    </asp:TextBox>
                                </p>
                            </div>
                            <div class="formright">
                                <p>
                                    <label>
                                        Hãng sản xuất</label>
                                    <asp:TextBox ID="txtHangSanXuat" runat="server" CssClass="text-input large-input"></asp:TextBox>
                                </p>
                                <p>
                                    <label>
                                        Chủng loại</label>
                                    <asp:TextBox ID="txtChungLoai" runat="server" CssClass="text-input large-input"></asp:TextBox>
                                </p>
                                <hr>
                                <p>
                                    <label>
                                        Giá</label>
                                    <asp:TextBox ID="txtGia" runat="server" CssClass="text-input large-input"></asp:TextBox>
                                </p>
                                <p>
                            <input type="image" width="200px" heigh="200px" id="imageDemons" name="imageDemons" runat="server" src="/images/noimage.jpg" />
                                </p>
                            </div>
                            <div class="clear">
                            </div>
                            <script src="<%=LinkHelper.GetLinkJs("kTabs.js")%>" type="text/javascript"></script>
                            <p>
                                <div class="shadetabs">
                                    <ul>
                                        <li id="tabs1" onclick="show_next1('tabs1')" class="selected"><a href="javascript:void(0)">
                                            Tổng quan</a></li>
                                        <li id="tabs2" onclick="show_next1('tabs2')"><a href="javascript:void(0)">Thông số kỹ
                                            thuật</a></li>
                                        <li id="tabs3" onclick="show_next1('tabs3')"><a href="javascript:void(0)">Hình ảnh</a></li>
                                    </ul>
                                </div>
                            </p>
                            <p>
                                <div id="tabs1_data">
                                    <CKEditor:CKEditorControl ID="txtTongQuan" runat="server" Height="300px" Width="700px">
                                    </CKEditor:CKEditorControl>
                                </div>
                                <div id="tabs2_data" style="display: none;">
                                    <CKEditor:CKEditorControl ID="txtThongSo" runat="server" Height="300px" Width="700px">
                                    </CKEditor:CKEditorControl>
                                </div>
                                <div id="tabs3_data" style="display: none;">
                                    <CKEditor:CKEditorControl ID="txtAlbum" runat="server" Height="300px" Width="700px">
                                    </CKEditor:CKEditorControl>
                                </div>
                            </p>
                            <div class="clear">
                            </div>
                            <p>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtTenSanPham" Display="Dynamic" ValidationGroup="vdSanPham" ErrorMessage="Vui lòng nhập tên sản phẩm!"></asp:RequiredFieldValidator>
                                <asp:CompareValidator ID="CompareValidator1" Operator="DataTypeCheck" Type="Integer" runat="server" ControlToValidate="txtGia" ErrorMessage="Giá chỉ nhập số!" Display="Dynamic" ValidationGroup="vdSanPham" ></asp:CompareValidator>
                                <asp:CompareValidator ID="CompareValidator2" Operator="DataTypeCheck" Type="Integer" runat="server" ControlToValidate="txtThuTu" ErrorMessage="Thứ tự chỉ nhập số!" Display="Dynamic" ValidationGroup="vdSanPham" ></asp:CompareValidator>
                            </p>
                            <p>
                                <asp:Button runat="server" ID="btnOK" CssClass="button" ValidationGroup="vdSanPham" Text="Hoàn tất" OnClick="btnOK_OnClick" />
                            </p>
                        </fieldset>
                        <div class="clear">
                        </div>
                        <!-- End .clear -->
                    </div>
								
								
								</fieldset>
							</div>
                            <div class="tab-content" id="tab2" style="display: none;">
              <asp:Button ID="bttThemMoi" CssClass="button" runat="server" Text="Thêm mới" OnClick="bttThemMoi_OnClick" UseSubmitBehavior="False" BorderStyle="None" />
                        <table>
                            <thead>
                                <tr>
                                    <th>
                                        Hình ảnh
                                    </th>
                                    
                                    <th>
                                    </th> 
                                </tr>
                            </thead>
                            <tfoot>
                                <tr>
                                    <td colspan="7">
                                        <p style="font-weight: bold; margin-left: 30px; color: #545454; font-size: 12px;
                                            text-align: right">
                                            Tổng cộng:
                                            <asp:Label ID="ResultCount" runat="server"></asp:Label>
                                            hình
                                        </p>
                                        <center>
                                            <div style="font-size: 12px">
                                                <%if (TotalRecord > PagingSize)
                                                  {%>
                                                <!-- Paging { -->
                                                <ul class="paginator">
                                                    <%= PageString%>
                                                </ul>
                                                <!-- } Paging -->
                                                <%} %>
                                            </div>
                                        </center>
                                        <%--										<div class="pagination">
											<a href="#" title="First Page">« First</a><a href="#" title="Previous Page">« Previous</a>
											<a href="#" class="number" title="1">1</a>
											<a href="#" class="number" title="2">2</a>
											<a href="#" class="number current" title="3">3</a>
											<a href="#" class="number" title="4">4</a>
											<a href="#" title="Next Page">Next >></a><a href="#" title="Last Page">Last »</a>
										</div> <!-- End .pagination -->
                                        --%>
                                        <div class="clear">
                                        </div>
                                    </td>
                                </tr>
                            </tfoot>
                            <tbody>
                                <asp:Repeater ID="repSanPham" runat="server" OnItemDataBound="repSanPham_OnItemDataBound">
                                    <ItemTemplate>
                                        <tr class="alt-row">
                                            <td>
                                                <a href='<%#LinkHelper.LinkAdminHinhAnhSP(Eval("ID"),Eval("SanPham"))%>'>
                            <img src="<%#LinkHelper.GetLinkHinhAnh(Eval("HinhAnh"))%>" width="75px" height="50px" />
                                                    </a>
                                            </td>
                                            
                                            <td style="vertical-align:middle">
                                                <!-- Icons -->
                                                <a  href='<%#LinkHelper.LinkAdminHinhAnhSP(Eval("ID"),Eval("SanPham"))%>' title="Edit">
                                                    <img src="resources/images/icons/pencil.png" alt="Edit"></a> 
              <asp:Button ID="learnMoreButton" CssClass="button" runat="server" Text="Xóa" CommandArgument='<%#Eval("ID")%>' OnClick="learnMoreButton_Click" UseSubmitBehavior="False" BorderStyle="None" />
                                            
                                            </td>
                                        </tr>
                                    </ItemTemplate>
                                </asp:Repeater>
                            </tbody>
                        </table>
                            </div>
							<div class="clear"></div><!-- End .clear -->
							
						</form>
					
				</div> <!-- End .content-box-content -->
				
			</div> <!-- End .content-box -->
			
			
			<div id="footer">
				<small>
				</small>
			</div><!-- End #footer -->
			
		</div> <!-- End #main-content -->
		
        </asp:Content>
